package davey.wu.junit44.assertdemo;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.containsString;
import static org.junit.matchers.JUnitMatchers.either;
import static org.junit.matchers.JUnitMatchers.hasItem;
import static org.junit.Assume.*;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class SimpleTest {
	@Test
	public void testAssertThat1() {
		int x = 3;
		assertThat(x, is(3));
		assertThat(x, is(not(4)));

		String responseString = "this is colcor test";
		assertThat(responseString, either(containsString("color")).or(containsString("colour")));

		List<String> myList = new ArrayList<String>();
		myList.add("2");
		myList.add("3");
		assertThat(myList, hasItem("3"));
	}

	@Test
	public void filenameIncludesUsername() {
		assumeThat(File.separatorChar, is('/'));
		String configFileName = "bconfigfiles1" + File.separatorChar + "optimus.cfg";
		assertThat(configFileName, is("configfiles/optimus.cfg"));
	}
}
